package com.clear.honghefinance.biz.modules.system.member.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 * 手机短信验证码登录DTO
 * </p>
 */
@Getter
@Setter
public class PhoneSmsCodeLoginDTO implements Serializable {

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式有误")
    private String phone;

    /**
     * 短信验证码
     */
    @ApiModelProperty(value = "短信验证码")
    @NotBlank(message = "请输入短信验证码")
    @Pattern(regexp = "^[0-9]{6}$", message = "短信验证码格式不正确")
    // todo 可以优化为自定义校验注解, 校验短信验证码是否正确,不通过抛出异常
    private String smsCode;
}
